For Each Of
AutomatR.DefaultActivities.Loop.ForEachOf<T>
The "For Each Of" activity in AutomatR is designed to iterate over a collection of items, performing a set of actions for each item in the collection. This activity simplifies the process of iterating through a list, array, or any enumerable type, making it easier to handle repetitive tasks in your workflows.
Properties
Name | Description |
---|---|
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Values | Specifies the collection of items to iterate over. It represents the enumerable type containing the items for iteration. Variables or expressions of type IEnumerable<T> . |
How to use:
- Drag and drop the "For Each Of" activity onto the workflow.
- Configure the properties by specifying the collection of items (Values) and defining the actions to perform for each item (Body).
- Execute the workflow, and the specified actions will be performed for each item in the collection.
Example: Consider an example where the "For Each Of" activity is used to iterate through a list of strings and print each string to the console:
For Each Of:
Values: myList
Body:
WriteLine:
Text: currentItem
In this example, the activity iterates through the list named "myList," and for each string item, it executes the "WriteLine" activity to print the item to the console.